# 执行命令
# docker build -t python-anaconda-3-vscode .

FROM mcr.microsoft.com/devcontainers/anaconda:0-3

# Copy environment.yml (if found) to a temp location so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
RUN sed -i 's#http://deb.debian.org#https://mirrors.163.com#g' /etc/apt/sources.list \
    && sed -i "s#http://security.debian.org#https://mirrors.163.com#g" /etc/apt/sources.list \
    && apt-get update && apt-get clean \
    && if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 \
    && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
    && conda update --yes -n base conda --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle \
    && pip install --upgrade pip -i https://repo.huaweicloud.com/repository/pypi/simple \
    && rm -rf /tmp/conda-tmp
    

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
#     && apt-get -y install --no-install-recommends <your-package-list-here>
